<!-- 下载模板 -->
<template>
  <div class="downTemplateBtn">
    <el-button
      slot="trigger"
      size="small"
      icon="el-icon-download"
      type="primary"
      style="margin-left: 5px"
      @click="download"
      >下载模板</el-button
    >
  </div>
</template>

<script>
import { getToken } from "@/util/auth";
export default {
  props: {
    customUrl: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
  components: {},
  methods: {
    //下载模板
    download() {
      var url = `${this.customUrl}?Blade-Auth=bearer ${getToken()}`;
      this.downFile(url);
    },
  },
};
</script>

<style lang="scss" scoped>
.downTemplateBtn {
  display: inline-block;
}
</style>
